<%-- 
    Document   : login-box
    Created on : Apr 18, 2011, 10:47:37 PM
    Author     : dangkhoa
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

<div id="content">
    <div id="login-box">
        <div class="contentTitle">
            <p class="title"><bean:message key="login.label.title" /></p>
        </div>
        <div id="login-input">
            <html:form action="/submitLogin">
            <table>
                <tr>                    
                    <td style="color: red" colspan="2">
                        <html:errors />
                    </td>
                </tr>
                <tr>
                    <th><bean:message key="login.label.email" /></th>                    
                    <td><html:text property="email" styleId="email"/></td>
                </tr>
                <tr>
                    <th><bean:message key="login.label.password" /></th>
                    <td><html:password property="password" styleId="password" /></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <html:submit onclick="validateLoginForm();"><bean:message key="login.button.submit" /></html:submit>
                    </td>
                </tr>
            </table>
            </html:form>
        </div>
        <div id="login-hyperlink">
            <a href="#">Đăng Ký</a> |
            <a href="#">Quên Mật Khẩu</a> |
            <a href="#">Qui định / Chính sách</a>
        </div>
</div>
</div>

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript">        
        function validateLoginForm(){
            debugger;
            $("document.LoginForm").validate({
                    rules: {
                            email: "required",
                            password: "required"
                    },
                    messages: {
                            email : "*",
                            password: "*"
                    }
            });
        }
</script>